package cate.game.activity.mooncake;

import cate.game.activity.base.core.RoleActivitySingle;
import cate.game.activity.mooncake.msg.MooncakeInfoResp;
import cate.game.role.Role;
import easy.java.dev.note.NoteField;

public class MooncakeActivity extends RoleActivitySingle {
    @NoteField("月饼boss挑战")
    public MooncakeChallenge challenge;
    @NoteField("月饼兑换")
    public MooncakeExchange exchange;
    @NoteField("月饼战令")
    public MooncakeWarOrder warOrder;

    @Override
    public void initialize(Role role) {
        super.initialize(role);
        if (challenge == null) {
            challenge = new MooncakeChallenge();
        }
        challenge.initialize(this);
        if (exchange == null) {
            exchange = new MooncakeExchange();
        }
        exchange.initialize(this);
        if (warOrder == null) {
            warOrder = new MooncakeWarOrder();
        }
        warOrder.initialize(this);
    }

    @Override
    public void onDaySpan(boolean silence) {
        super.onDaySpan(silence);
        challenge.onDaySpan(silence);
        exchange.onDaySpan(silence);
        warOrder.onDaySpan(silence);

    }

    @Override
    public void onRoleOpen() {
        challenge.onRoleOpen();
    }

    @Override
    public void onRoleEnd() {
        challenge.onRoleEnd();
        exchange.onRoleEnd();
        warOrder.onRoleEnd();

    }

    @Override
    public void initSend() {
        noticeUpdate();
    }

    @Override
    public void excelCheck() {
        exchange.excelCheck();
    }

    public void noticeUpdate() {
        role.sendNow(new MooncakeInfoResp(this));
    }
}
